package models

import (
	"time"
	"tms-server/driver"
)

type Attachment struct {
	Id       int64     `xorm:"pk autoincr int(11)"`
	Path     string    `xorm:"varchar(50)"`
	Orgpicid int       ``
	Exif     string    `xorm:"TEXT"`
	Tm       time.Time ``
	Orgname  string    `xorm:"varchar(255)"`
	Ver      int       `xorm:"version"`
}

func (attachment *Attachment) Create() (err error) {
	id, err := driver.X.Insert(*attachment)
	if err != nil {
		return
	}
	attachment.Id = id
	return
}
